/**
 * Copyright (C) 2008 GeoScheduler Team, as stated on <http://www.geoscheduler.org/authors>.
 * 
 * This file is part of GeoScheduler.
 * 
 * GeoScheduler is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * GeoScheduler is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with GeoScheduler. If not, see <http://www.gnu.org/licenses/>.
 */

package org.geoscheduler.model.dto;

import java.util.Date;

import org.geoscheduler.commons.marshaller.JSONField;
import org.geoscheduler.model.Account;

/**
 * 
 * <h2>EventQueryDTO</h2>
 * <p>
 * Transfer object for queries on events.
 * </p>
 * 
 * @author lko
 */
public class EventQueryDTO {

	private Account account;

	private int lat;
	private int lon;

	private Date timeFrom;
	private Date timeTo;

	private int offset;
	private int maxResults;

	public Account getAccount() {
		return account;
	}

	public long getIdAccount() {
		if (account != null) {
			return account.getId();
		} else {
			return 0;
		}
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@JSONField
	public int getLat() {
		return lat;
	}

	public void setLat(int lat) {
		this.lat = lat;
	}

	@JSONField
	public int getLon() {
		return lon;
	}

	public void setLon(int lon) {
		this.lon = lon;
	}

	public int getLat0() {
		return this.lat;
	};

	public int getLat1() {
		return this.lat >> 1;
	};

	public int getLat2() {
		return this.lat >> 2;
	};

	public int getLat3() {
		return this.lat >> 3;
	};

	public int getLat4() {
		return this.lat >> 4;
	};

	public int getLat5() {
		return this.lat >> 5;
	};

	public int getLat6() {
		return this.lat >> 6;
	};

	public int getLat7() {
		return this.lat >> 7;
	};

	public int getLat8() {
		return this.lat >> 8;
	};

	public int getLat9() {
		return this.lat >> 9;
	};

	public int getLat10() {
		return this.lat >> 10;
	};

	public int getLat11() {
		return this.lat >> 11;
	};

	public int getLat12() {
		return this.lat >> 12;
	};

	public int getLat13() {
		return this.lat >> 13;
	};

	public int getLat14() {
		return this.lat >> 14;
	};

	public int getLat15() {
		return this.lat >> 15;
	};

	public int getLat16() {
		return this.lat >> 16;
	};

	public int getLat17() {
		return this.lat >> 17;
	};

	public int getLat18() {
		return this.lat >> 18;
	};

	public int getLat19() {
		return this.lat >> 19;
	};

	public int getLat20() {
		return this.lat >> 20;
	};

	public int getLat21() {
		return this.lat >> 21;
	};

	public int getLat22() {
		return this.lat >> 22;
	};

	public int getLat23() {
		return this.lat >> 23;
	};

	public int getLat24() {
		return this.lat >> 24;
	};

	public int getLat25() {
		return this.lat >> 25;
	};

	public int getLat26() {
		return this.lat >> 26;
	};

	public int getLat27() {
		return this.lat >> 27;
	};

	public int getLat28() {
		return this.lat >> 28;
	};

	public int getLat29() {
		return this.lat >> 29;
	};

	public int getLat30() {
		return this.lat >> 30;
	};

	public int getLat31() {
		return this.lat >> 31;
	};

	public int getLon0() {
		return this.lon >> 0;
	};

	public int getLon1() {
		return this.lon >> 1;
	};

	public int getLon2() {
		return this.lon >> 2;
	};

	public int getLon3() {
		return this.lon >> 3;
	};

	public int getLon4() {
		return this.lon >> 4;
	};

	public int getLon5() {
		return this.lon >> 5;
	};

	public int getLon6() {
		return this.lon >> 6;
	};

	public int getLon7() {
		return this.lon >> 7;
	};

	public int getLon8() {
		return this.lon >> 8;
	};

	public int getLon9() {
		return this.lon >> 9;
	};

	public int getLon10() {
		return this.lon >> 10;
	};

	public int getLon11() {
		return this.lon >> 11;
	};

	public int getLon12() {
		return this.lon >> 12;
	};

	public int getLon13() {
		return this.lon >> 13;
	};

	public int getLon14() {
		return this.lon >> 14;
	};

	public int getLon15() {
		return this.lon >> 15;
	};

	public int getLon16() {
		return this.lon >> 16;
	};

	public int getLon17() {
		return this.lon >> 17;
	};

	public int getLon18() {
		return this.lon >> 18;
	};

	public int getLon19() {
		return this.lon >> 19;
	};

	public int getLon20() {
		return this.lon >> 20;
	};

	public int getLon21() {
		return this.lon >> 21;
	};

	public int getLon22() {
		return this.lon >> 22;
	};

	public int getLon23() {
		return this.lon >> 23;
	};

	public int getLon24() {
		return this.lon >> 24;
	};

	public int getLon25() {
		return this.lon >> 25;
	};

	public int getLon26() {
		return this.lon >> 26;
	};

	public int getLon27() {
		return this.lon >> 27;
	};

	public int getLon28() {
		return this.lon >> 28;
	};

	public int getLon29() {
		return this.lon >> 29;
	};

	public int getLon30() {
		return this.lon >> 30;
	};

	public int getLon31() {
		return this.lon >> 31;
	};

	@JSONField
	public Date getTimeFrom() {
		return timeFrom;
	}

	public void setTimeFrom(Date timeFrom) {
		this.timeFrom = timeFrom;
	}

	@JSONField
	public Date getTimeTo() {
		return timeTo;
	}

	public void setTimeTo(Date timeTo) {
		this.timeTo = timeTo;
	}

	@JSONField
	public int getOffset() {
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	@JSONField(defaultValue = "1000")
	public int getMaxResults() {
		if (maxResults == 0) {
			return 1000;
		} else {
			return maxResults;
		}
	}

	public void setMaxResults(int maxResults) {
		this.maxResults = maxResults;
	}

}
